using Bases;
using Mgrs;
using UnityEditor;
using UnityEngine.UI;

namespace Modules.Set
{
    public class SetPanel : MonoBehaviourSimplify
    {
        public Button btnExit;
        public Button btnBack;

        private void Awake()
        {
            btnExit.onClick.AddListener(OnBtnExit);
            btnBack.onClick.AddListener(OnBtnBack);
        }

        protected override void OnBeforeDestroy()
        {
        }

        private void OnBtnExit()
        {
            GUIManager.UnLoadPanel(nameof(SetPanel));

#if UNITY_EDITOR
            EditorApplication.isPlaying = false;
#else
            Application.Quit();
#endif
        }

        private void OnBtnBack()
        {
            GUIManager.UnLoadPanel(nameof(SetPanel));
        }
    }
}